from src.application.server.dto import ServerDTO
from src.application.server.uow import ServerUoW
from src.application.server.use_cases.get_user_by_id import GetServerById, GetServerByIdHandler


class ServerService:
    def __init__(
        self,
        *,
        uow: ServerUoW,
    ) -> None:
        self._uow = uow

    async def get_server_by_id(self, server_id: int) -> ServerDTO:
        """Получение полных данных о сервере по id"""

        command = GetServerById(server_id=server_id)
        return await GetServerByIdHandler(uow=self._uow)(command=command)
